package com.itheima.chapter03.characterstring;

import java.util.Scanner;

/*
    遍历字符串
 */
public class domestring4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String line = sc.nextLine();
        System.out.println(line.charAt(1));
        System.out.println("---------------------");
        for (int i = 0; i <line.length() ; i++) {
            System.out.println(line.charAt(i));
        }
    }
}
